/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package common.gui.progress;

import javax.swing.JLabel;

/**
 *
 * @author Nobody
 */
public class ProgressLabel extends JLabel implements IProgressItem {

    private int maximum;

    @Override
    public void beforeReading() {
        this.setText(BEFORE_READING);
    }

    @Override
    public void afterReading() {
        this.setText(AFTER_READING);
    }

    @Override
    public void setMaximum(int maximum) {
        this.maximum = maximum;
    }

    @Override
    public int getMaximum() {
        return maximum;
    }

    public void readed(double d) {
        this.setText(String.valueOf((int) ((float) d / getMaximum() * 100)) + " % readed.");
    }

    public void dispose() {
    }
}
